home *** CD-ROM | disk | FTP | other *** search
/ SGI Desktop Special Edition 1.1 / SGI Desktop Special Edition 1.1.iso / dist / mmail.idb / usr / lib / Zmail / bin / xwrap.z / xwrap
Encoding:
Text File  |  1995-11-13  |  1.5 KB  |  56 lines

  1. :
  2. # Wrapper script for starting X11 attachment viewer/editor utilities
  3. # Parts of this script require translation for non-English languages
  4. #
  5. # This file Copyright (c) 1992-94 Z-Code Software, a Division of NCD.
  6. # Permission to use, copy, modify, and distribute this material
  7. # for any purpose and without fee is hereby granted, provided
  8. # that the above copyright notice and this permission notice
  9. # appear in all copies, and that the name of Z-Code Software not
  10. # be used in advertising or publicity pertaining to this
  11. # material without the specific, prior written permission
  12. # of an authorized representative of Z-Code.  Z-CODE SOFTWARE
  13. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
  14. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
  15. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  16.  
  17. ttyinput=false
  18. ttyoutput=true
  19.  
  20. # Look for a tty in the obvious places
  21. if test -t 0
  22. then
  23.     ttyinput=true
  24. fi
  25. if test -t 2
  26. then
  27.     exec 2>&3
  28. elif test -t 1
  29. then
  30.     exec 1>&3
  31. elif $ttyinput
  32. then
  33.     exec 0>&3
  34. else
  35.     ttyoutput=false
  36. fi
  37.  
  38. # See if the DISPLAY veriable is set
  39. if test -z "$DISPLAY"
  40. then
  41.     if $ttyoutput
  42.     then
  43.     exec 3>&1
  44.     echo ""
  45.     echo This message part contains data which can currently be viewed
  46.     echo only when running X11.  If you read this message while running
  47.     echo X11, and have your DISPLAY variable set, you will then be able
  48.     echo to view the message part properly.
  49.     echo ""
  50.     fi
  51.     exit 1
  52. fi
  53.  
  54. # Everything looks OK -- run the argument list as a command
  55. exec "$@"
  56.